using System;
using System.Data;
using System.Data.SqlClient;
namespace DAL
{
    /**
     * Classname : Report
     * Version information :1.0
     * Date  :26-09-2006
     * Copyright notice : 
     */

    public class DAKhoaHoc : DbObject
    {
        protected SqlConnection connec;

        public DAKhoaHoc(SqlConnection Connection)
		{
            connec = Connection;
		}
        ///Load KhoaHoc all
        public DataTable loadKhoaHocAll()
        {
            DataTable dtData = new DataTable();
            SqlParameter[] parameters = {};// =  {	 new SqlParameter("@LevelID", SqlDbType.Int,4 )  
                                         
            //                             };
            //// set the 0values
            //parameters[0].Value = LevelID;
            // create the parameter
            DataSet dsHocVien = RunProcedure("sp_KhoaHoc_loadKhoaHocAll", parameters, "Tb_KhoaHoc", connec);
            if (dsHocVien != null)
            {
                dtData = dsHocVien.Tables[0];
            }
            return dtData;
        }
        public int insertKhoaHoc(string Name, int OrderView)
        {
            int numAffected = 0;
            // create the parameters
            SqlParameter[] parameters =  {	    
                                                new SqlParameter("@Name", SqlDbType.NVarChar),
                                                new SqlParameter("@OrderView", SqlDbType.Int,4)                                        
										 };
            // set the 0values
            parameters[0].Value = Name;
            parameters[1].Value = OrderView;
            // run the procedure
            RunProcedure("sp_KhoaHoc_Insert", parameters, out numAffected, connec);

            return numAffected;
        }
    }
}